package com.example.retrofitdemo

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass

@JsonClass(generateAdapter = true)
data class ArticleBean(
    @Json(name = "errorCode")
    val code: Int = 0, // 200
    @Json(name = "errorMsg")
    val message: String = "", // 成功!
    @Json(name = "data")
    val page: PageData
)

@JsonClass(generateAdapter = true)
data class PageData(
    @Json(name = "datas")
    val articles: List<ArticleData>
)

@JsonClass(generateAdapter = true)
data class ArticleData(
    @Json(name = "title")
    val title: String,
    @Json(name = "link")
    val link: String
)